#include "wechatpaydialog.h"
#include "paywindow.h"
#include "ui_wechatpaydialog.h"

WechatPayDialog::WechatPayDialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::WechatPayDialog)
{
    ui->setupUi(this);
}

WechatPayDialog::~WechatPayDialog()
{
    delete ui;
}

void WechatPayDialog::on_pushButton_clicked()
{
    qDebug() << "Payment button clicked, emitting signal with orderId:" << this->orderId;
    emit paymentCompleted(this->orderId);
    qDebug() << "Signal emitted"; // 添加调试输出，确认信号确实被发射
    this->accept();
}

void WechatPayDialog::onOrderIdReceived(int orderId)
{
    this->orderId = orderId; // 确保这个值在类内部保存
    qDebug() << "Received orderId in AliPayDialog:" << orderId;
}
